package com.ruoyi.business.common.core.controller;

import com.ruoyi.business.common.core.domain.AjaxResResult;
import com.ruoyi.common.core.controller.BaseController;
import lombok.extern.slf4j.Slf4j;

/**
 * @author twilight
 * @since V1.0
 */
@Slf4j
public class BsBaseController extends BaseController {

    /**
     * 返回成功消息
     */
    public AjaxResResult successRes(Object data)
    {
        return AjaxResResult.success(data);
    }

    /**
     * 响应返回结果
     *
     * @param rows 影响行数
     * @return 操作结果
     */
    protected AjaxResResult toAjaxRes(int rows)
    {
        return rows > 0 ? AjaxResResult.success() : AjaxResResult.error();
    }
}
